<!DOCTYPE html>
<!-- saved from url=(0035)http://www.qukiss.com/user/register -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>注册</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="layui/css/layui.css" media="all">
<link rel="stylesheet" href="layui/css/global.css" media="all">
<link rel="stylesheet" href="layui/css/desktop.css" media="all">
<link id="layuicss-skinlayercss" rel="stylesheet"
	href="layui/css/layer.css" media="all">
<link id="layuicss-laydatecss" rel="stylesheet"
	href="layui/css/laydate.css" media="all">
<script src="layui/layui.js" charset="utf-8"></script>
<script src="js/jquery/jquery.min.js" charset="utf-8"></script>
</head>
<body>
	<div class="layui-header layui-bg-black header header-doc">
		<div class="layui-main">
			<ul class="layui-nav">
				<li class="layui-nav-item"><a
					href="/login.html">登陆</a></li>
				<li class="layui-nav-item layui-this"><a
					href="/regist.html">注册</a></li>
				<span class="layui-nav-bar" style="left: 72px; top: 56px; width: 0px; opacity: 0;"></span>
			</ul>
		</div>
	</div>
	<div class="layui-main" style="min-height: 640px;">
		<h2 class="page-title">注册</h2>
		<form action="" method="post"
			class="layui-form layui-form-pane">
			<input type="hidden" name="ChaoX_csrf_token"
				value="abbe9856b962439c8551303b58b453df">
			<div class="layui-form-item">
				<label class="layui-form-label" for="username">用户名</label>
				<div class="layui-input-inline">
					<input class="layui-input" type="text" id="username"
						name="username" lay-verify="username" value=""
						placeholder="请输入用户名" autocomplete="off">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label" for="password">密码</label>
				<div class="layui-input-inline">
					<input class="layui-input" type="password" id="password"
						name="password" lay-verify="password" value="" placeholder="请输入密码"
						autocomplete="off">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label" for="password_confirm">确认密码</label>
				<div class="layui-input-inline">
					<input class="layui-input" type="password" id="password_confirm"
						name="password_confirm" lay-verify="required" value=""
						placeholder="请输入确认密码" autocomplete="off">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label" for="telephone">联系方式</label>
				<div class="layui-input-inline">
					<input class="layui-input" type="text" id="telephone" name="telephone"
						lay-verify="telephone" value="" placeholder="请输入联系方式"
						autocomplete="off">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label" for="sex">性别</label>
				<div class="layui-input-inline">
					<input class="layui-input" type="text" id="sex" name="sex"
						lay-verify="sex" value="" placeholder="请输入性别"
						autocomplete="off">
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-input-block">
					<button id="userRegist" class="layui-btn" type="button">立即注册</button>
					<a class="layui-btn layui-btn-primary"
						href="/login.html">已有账号？</a>
				</div>
			</div>
		</form>
	</div>
	<script>
	var getUser= function(curr) {
		$.ajax({
			type : "GET",
			dataType : "json",
			url : "/user/add",
			data : {
				"userName" : $("#userName").val(),
				"pwdword" : $("#pwdword").val(),
				"sex" : $("#sex").val(),
				"telephone" : $("#telephone").val()
			//向服务端传的参数，此处只是演示
			},
			success : function(msg) {
					alert(msg);
				$('#userLogin').click(); 
			}
		});
	}
	
	//注册用户
	$("#addUser").on('click', function() {
		layer.open({ //弹出层
			type : 2,
			title : '添加用户',
			fix : false,
			maxmin : true,
			shadeClose : true,
			area : [ '1100px', '600px' ],
			content : 'user_add.html',//弹出层页面html内容，因为只是静态页面，单纯的添加数据
			end : function() {
				getUserList();//当添加成功后，刷新一下页面  即调用getUserList这个函数（方法）
			}
		});

	});
	</script>
</body>
</html>